package com.gz.spring.component;

import com.gz.spring.annotation.Component;
import com.gz.spring.processor.BeanPostProcessor;


@Component //保证后置处理器能被扫描到
public class GzBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        System.out.println("后置处理器GzBeanPostProcessor Before调用 Bean的类型="
                + bean.getClass()+"Bean的名字= "+beanName);
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        System.out.println("后置处理器GzBeanPostProcessor After调用 Bean的类型="
                + bean.getClass()+"Bean的名字= "+beanName);
        return bean;
    }
}
